package com.yserp.project.erp.order.selfpurchrigistration.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yserp.common.utils.mybatis.MybatisPlusUtil;
import com.yserp.project.erp.common.util.DateSearchUtils;
import com.yserp.project.erp.order.selfpurchrigistration.domain.SelfPurchRigistration;
import com.yserp.project.erp.order.selfpurchrigistration.mapper.SelfPurchRigistrationMapper;
import com.yserp.project.erp.order.selfpurchrigistration.service.ISelfPurchRigistrationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 自购物料登记Service业务层处理
 *
 * @author yserp
 * @date 2022-08-09
 */
@Service
public class SelfPurchRigistrationServiceImpl extends ServiceImpl<SelfPurchRigistrationMapper, SelfPurchRigistration> implements ISelfPurchRigistrationService {
    @Resource
    private SelfPurchRigistrationMapper selfPurchRigistrationMapper;


    /**
     * 查询自购物料登记列表
     *
     * @param selfPurchRigistration 自购物料登记
     * @return 自购物料登记
     */
    @Override
    public List<SelfPurchRigistration> selectSelfPurchRigistrationList(SelfPurchRigistration selfPurchRigistration) {
        QueryWrapper<SelfPurchRigistration> queryWrapper = new QueryWrapper<>();
        MybatisPlusUtil.notNullField(selfPurchRigistration, queryWrapper);
        //对时间区间的处理
        DateSearchUtils.queryDateRange(selfPurchRigistration, queryWrapper);
        return selfPurchRigistrationMapper.selectList(queryWrapper);
    }

}
